# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=fluidd

pkgver=1.26.3
pkgrel=1
pkgdesc='A free and open-source Klipper web interface for managing your 3d printer'
arch=(any)
url=https://docs.fluidd.xyz/
license=(GPL3)
makedepends=(
  git
  nodejs-lts-hydrogen
  npm
)
optdepends=('ustreamer: webcam streaming support')
_tag=79daaf0ee6a2f2c8b2624972dda979a5be666ea3
source=(git+https://github.com/fluidd-core/fluidd.git#tag=${_tag})
validpgpkeys=(4C717BDC0E452F5B13490409AB4C64C58BA9C3ED) # Pedro Lamas <pedrolamas@gmail.com>
b2sums=(SKIP)

pkgver() {
  cd fluidd
  git describe --tags | sed 's/^v//'
}

build() {
  cd fluidd
#  npm config set registry https://registry.loongnix.cn:5873/
  npm install --frozen-lockfile
  npm run build
}

package() {
  install -dm 755 "${pkgdir}"/usr/share/webapps
  cp -dr --no-preserve=ownership fluidd/dist "${pkgdir}"/usr/share/webapps/fluidd
}

# vim: ts=2 sw=2 et:
